import request from '@/utils/request'

export default {
    //添加租户
    saveTenat(tenant) {
        return request ({
          url: `/admin/acl/user/save`,
          method: 'post',
          data: tenant
        })
    },
    updateTenant(user) {
        return request ({
            url: `/admin/acl/user/update`,
            method: 'put',
            data: user
        })
    },
    //根据租户id查询
    getTenantById(userId) {
        return request ({
        url: `/admin/acl/user/get/${userId}`,
        method: 'get'
        })
    },
    getTenantList(page, limit, category, isAdmin, searchObj) {
        return request ({
          url: `/admin/acl/user/pageTenantList/${page}/${limit}/${category}/${isAdmin}`,
          method: 'get',
          params: searchObj // url查询字符串或表单键值对
        })
    },
    getTenantList2(page, limit, category, isAdmin, searchObj) {
        return request ({
          url: `/admin/acl/user/pageTenantList2/${page}/${limit}/${category}/${isAdmin}`,
          method: 'get',
          params: searchObj // url查询字符串或表单键值对
        })
    },
    getTenantRoleList(category){
      return request ({
        url: `/admin/acl/user/getTenantRoleList/${category}`,
        method: 'get'
      })
    },
    deleteByIds(id){
        return request ({
          url: `/admin/acl/user/remove/${id}`,
          method: 'delete'
        })
    },
    changeEnable(id) {
        return request ({
          url: `/admin/acl/user/changeStatus/${id}`,
          method: 'get'
        })
    },
    usernameIsExist(username) {
      return request ({
        url: `/admin/acl/user/usernameIsExist/${username}`,
        method: 'get'
      })
    }
}
